﻿namespace CommonAPI.Data.Model;

public record CityItem(
    int Id,
    string Name,
    string FullName,
    IReadOnlyList<CityItem> Citys
);

internal class CityItemInternal {
    public int Id { get; set; }
    public string Name { get; set; } = string.Empty;
    public string FullName { get; set; } = string.Empty;
    public IReadOnlyList<CityItemInternal> Citys { get; set; } = new List<CityItemInternal>();

    public CityItem ToCityItem() => new(
        Id,
        Name,
        FullName,
        Citys.Select(x => x.ToCityItem()).ToList()
    );
}